﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using ajayumi.develop.win32.Transport.WCF.Services.Interfaces;

namespace ajayumi.develop.win32.Transport.Client.WinForm.Controls
{
    /// <summary>
    /// 硬盘驱动器客户端类
    /// Author  : 黄乙冬
    /// Date    : 2011-08-30
    /// </summary>
    public class DriveServiceClient : ClientBase<IDrive>, IDrive, IDisposable
    {
        public DriveServiceClient()
            : base("Drive")
        {
        }

        #region IDrive
        public string[] GetDirectories(string parentDir, bool hasFile)
        {
            return base.Channel.GetDirectories(parentDir, hasFile);
        }

        public string CreateDir(string parentDir, string dirName)
        {
            return base.Channel.CreateDir(parentDir, dirName);
        }

        public string[] GetFiles(string dir, bool isRecursion)
        {
            return base.Channel.GetFiles(dir, isRecursion);
        }

        #endregion

        #region IDisposable

        void IDisposable.Dispose()
        {
            if (this.State == CommunicationState.Opened)
            { this.Close(); }
        }

        #endregion


    }
}
